//
//  CheckSelectedView.m
//  PropertyMananger
//
//  Created by bh on 17/3/1.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "CheckSelectedView.h"

@implementation CheckSelectedView

- (instancetype)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];
    if (self) {
        
        self.selectedMonthBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.selectedMonthBtn];
        [self.selectedMonthBtn setImage:IMG(@"ico_statistics_month") forState:UIControlStateNormal];
        //点击选择月份
        // [self.monthButton addTarget:self action:@selector(selectedMonth:) forControlEvents:UIControlEventTouchUpInside];
        
        [self.selectedMonthBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(40, 40));
        }];
        
        self.monthLabel = [[UILabel alloc]init];
        [self addSubview:self.monthLabel];
        
        self.monthLabel.textAlignment = NSTextAlignmentCenter;
        self.monthLabel.textColor = Theme_Color;
        self.monthLabel.font = BHFont(15);
        self.monthLabel.text = @"1月";
        
        [self.monthLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.selectedMonthBtn.mas_trailing).with.offset(-5);
            make.centerY.equalTo(self.selectedMonthBtn).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(35, 25));
        }];
        
        UIView * lineView = [[UIView alloc]init];
        [self addSubview:lineView];
        
        lineView.backgroundColor = BHColor(230, 230, 230);
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(85, 1));
            make.bottom.equalTo(self).with.offset(0);
        }];

        

    }
    return self;
}

@end
